/*
 NSDictionaryAdditions.h
 MailDelivery
 
 Created by Dante Palacios on 26/08/09.
 Copyright 2009 Dante Palacios. All rights reserved.
 */


/*!
 @header NSDictionaryAdditions.h
 @discussion This header contains some utility methods for the framework. Some of these methods may disappear or change their names without prior notice. For more information, contact palacios.dante\@gmail.com.
 */

#import <Foundation/Foundation.h>


@class NSImage;

/*!
 @category NSDictionary(NSDictionaryAdditions)
 @discussion Used by framework to get message properties.
 */

@interface NSDictionary(NSDictionaryAdditions)

/*!
 @method objectForCaseInsensitiveKey:
 @discussion .
 @param aKey
 the key for the object.
 */

- (id)objectForCaseInsensitiveKey:(NSString *)aKey;

@end

@interface NSDictionary(NSDictionaryMailDeliveryAdditions)

/*!
 @method adresseesForMessageHeader:
 @discussion .
 @param headerName
 the name of the message header.
 */

- (NSArray *)adresseesForMessageHeader:(NSString *)headerName;

@end

/*!
 @category NSDictionary(DeliveryAccountAdditions)
 @discussion Used to easily access the properties of the represented account.
 */

@interface NSDictionary(DeliveryAccountAdditions)

/*!
 @method name
 @abstract the name of this account.
 @discussion Returns the value for the key kDeliveryAccountName.
 */

- (NSString *)name;

/*!
 @method defaultSender
 @abstract the default sender for an account.
 @discussion returns a full email address by taking <tt>fullName</tt> and the first email address of <tt>emailAddresses</tt>. 
 */

- (NSString *)defaultSender;

/*!
 @method emailAddresses
 @abstract all email addresses for an account.
 @discussion the value for the key kDeliveryAccountEmailAddresses.
 */

- (NSArray *)emailAddresses;

/*!
 @method fullName
 @abstract the value for the key kDeliveryAccountFullUserName.
 */

- (NSString *)fullName;

/*!
 @method hostName
 @abstract the value for the key kDeliveryAccountHostName.
 */

- (NSString *)hostName;

/*!
 @method userName
 @abstract the value for the key kDeliveryAccountUserName.
 */

- (NSString *)userName;

/*!
 @method password
 @abstract Returns the value for the key kDeliveryAccountPassword.
 */

- (NSString *)password;

/*!
 @method authentication
 @abstract Returns the value for the key kDeliveryAccountAuthentication.
 */

- (NSInteger)authentication;

/*!
 @method identifier
 @abstract Returns the identifier of the account.
 @discussion E.g. smtp.domain.com:janedoe.
 */

- (NSString *)identifier;

/*!
 @method icon
 @abstract Returns the icon of the account.
 @discussion If the account is not MobileMe, this method always returns the generic icon returned by <tt>SMTPMailDelivery</tt> class method @link //maildelivery_ref/occ/clm/SMTPMailDelivery/genericEmailAccountIconImage genericEmailAccountIconImage @/link
 */

- (NSImage *)icon;

/*!
 @method port
 @abstract Returns the value for the key kDeliveryAccountPort.
 @discussion If not specified, this methods returns port 587.
 */

- (NSInteger)port;

/*!
 @method usesDefaultPorts
 @abstract  the value for the key kDeliveryAccountUsesDefaultPorts.
 @discussion If not specified, this methods returns YES.
 */

- (BOOL)usesDefaultPorts;

/*!
 @method usesSsl
 @abstract  Returns the value for the key kDeliveryAccountUsesSSL.
 @discussion If not specified, this methods returns YES.
 */

- (BOOL)usesSsl;

/*!
 @method SSLSecurityLevel
 @abstract  Returns the value for the key kDeliveryAccountUsesSSL.
 @discussion If not specified and <tt>usesSsl</tt>, this methods returns <tt>MailDeliverySecurityLevelTLSv1</tt>.
 */

- (NSInteger)SSLSecurityLevel;

@end

@interface NSMutableDictionary(NSMutableDictionaryAdditions)

- (void)removeObjectForCaseInsensitiveKey:(NSString *)aKey;

@end